import Vue from 'vue'
import Vuex from 'vuex'
import api from '@/api'
import site from '@/config/site'
Vue.use(Vuex)
/*
 1 - 7 对应路由里的 1 - 7 ， 即左侧菜单项 
 */
const store = new Vuex.Store({
  state: {
    1: {},
    2: {},
    3: {},
    4: {},
    5: {},
    6: {},
    7: {},
    toast: '',
  },
  mutations: {
    updateToast (state, payload) {
      state.toast = payload
    },
    1 (state, payload) {
      
    }
  },
  actions: {
    toast ({ commit }, payload) {
      commit('updateToast', payload)
      setTimeout(() => commit('updateToast', ''), 300)
    },
    1 ({ commit }, payload) {
    }
  }
})

export default store
